]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Add initial calls to Gettext
authorColin Walters <walters@verbum.org>
Fri, 14 Aug 2009 13:30:48 +0000 (09:30 -0400)
committerColin Walters <walters@verbum.org>
Fri, 14 Aug 2009 13:32:15 +0000 (09:32 -0400)
We don't have a lot of strings, and what ones we do have we've
been avoiding duplication.  This patch adds calls to _() i.e. gettext
for those strings we do have.

js/ui/appDisplay.js
js/ui/dash.js
js/ui/panel.js
js/ui/runDialog.js
js/ui/widget.js

index 906c45fc2b2338b2300387efa0d5316c2769eaea..bee50ced631919d20e8ec5b85a3215ec3f8294ad 100644 (file)
@@ -11,6 +11,8 @@ const Shell = imports.gi.Shell;
 const Lang = imports.lang;
 const Signals = imports.signals;
 const Mainloop = imports.mainloop;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const DND = imports.ui.dnd;
 const GenericDisplay = imports.ui.genericDisplay;
@@ -311,7 +313,7 @@ AppDisplay.prototype = {
 
     _redisplayMenus: function() {
         this._menuDisplay.remove_all();
-        this._addMenuItem('Frequent', null, 'gtk-select-all');
+        this._addMenuItem(_("Frequent"), null, 'gtk-select-all');
         for (let i = 0; i < this._menus.length; i++) {
             let menu = this._menus[i];
             this._addMenuItem(menu.name, menu.id, menu.icon, i+1);
index 4028c8de6dcbdd2c480a72fb84cc1f9ad0eaa420..0a32a9717846968f4cfe399713f658e0546e3373 100644 (file)
@@ -8,6 +8,8 @@ const Pango = imports.gi.Pango;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 const Lang = imports.lang;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const AppDisplay = imports.ui.appDisplay;
 const DocDisplay = imports.ui.docDisplay;
@@ -230,7 +232,7 @@ SearchEntry.prototype = {
                                    border_color: SEARCH_BORDER_BOTTOM_COLOR });
         this.pane = null;
 
-        this._defaultText = "Find apps or documents";
+        this._defaultText = _("Find apps or documents");
 
         let textProperties = { font_name: "Sans 12" };
         let entryProperties = { editable: true,
@@ -331,7 +333,7 @@ MoreLink.prototype = {
 
         let text = new Clutter.Text({ font_name: "Sans 12px",
                                       color: BRIGHT_TEXT_COLOR,
-                                      text: "Browse" });
+                                      text: _("Browse") });
         this.actor.append(text, Big.BoxPackFlags.NONE);
 
         this.actor.connect('button-press-event', Lang.bind(this, function (b, e) {
@@ -467,12 +469,12 @@ Dash.prototype = {
                 this._searchPane = new ResultPane(this);
                 this._searchPane.content.append(new Clutter.Text({ color: TEXT_COLOR,
                                                                    font_name: 'Sans Bold 10px',
-                                                                   text: "APPLICATIONS" }),
+                                                                   text: _("APPLICATIONS") }),
                                                  Big.BoxPackFlags.NONE);
                 this._searchAreaApps = this._searchPane.packResults(AppDisplay.AppDisplay, false);
                 this._searchPane.content.append(new Clutter.Text({ color: TEXT_COLOR,
                                                                    font_name: 'Sans Bold 10px',
-                                                                   text: "RECENT DOCUMENTS" }),
+                                                                   text: _("RECENT DOCUMENTS") }),
                                                  Big.BoxPackFlags.NONE);
                 this._searchAreaDocs = this._searchPane.packResults(DocDisplay.DocDisplay, false);
                 this._addPane(this._searchPane);
@@ -540,7 +542,7 @@ Dash.prototype = {
 
         /***** Applications *****/
 
-        let appsSection = new Section("APPLICATIONS");
+        let appsSection = new Section(_("APPLICATIONS"));
         let appWell = new AppDisplay.AppWell();
         appsSection.content.append(appWell.actor, Big.BoxPackFlags.EXPAND);
 
@@ -558,14 +560,14 @@ Dash.prototype = {
 
         /***** Places *****/
 
-        let placesSection = new Section("PLACES", true);
+        let placesSection = new Section(_("PLACES"), true);
         let placesDisplay = new Places.Places();
         placesSection.content.append(placesDisplay.actor, Big.BoxPackFlags.EXPAND);
         this.sectionArea.append(placesSection.actor, Big.BoxPackFlags.NONE);
 
         /***** Documents *****/
 
-        let docsSection = new Section("RECENT DOCUMENTS");
+        let docsSection = new Section(_("RECENT DOCUMENTS"));
 
         let docDisplay = new DocDisplay.DocDisplay();
         docDisplay.load();
index c919ada851d721c0bdf588a3dedc97ec7a795bfc..97b21d6b80e1a4cf7f760bcf78f4118aee9f102e 100644 (file)
@@ -9,6 +9,8 @@ const Meta = imports.gi.Meta;
 const Shell = imports.gi.Shell;
 const Tweener = imports.ui.tweener;
 const Signals = imports.signals;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const Button = imports.ui.button;
 const Main = imports.ui.main;
@@ -261,7 +263,7 @@ Panel.prototype = {
 
         /* left side */
 
-        this.button = new Button.Button("Activities", PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
+        this.button = new Button.Button(_("Activities"), PANEL_BUTTON_COLOR, PRESSED_BUTTON_BACKGROUND_COLOR,
                                         PANEL_FOREGROUND_COLOR, true, DEFAULT_FONT);
         this.button.button.height = PANEL_HEIGHT;
 
@@ -406,7 +408,8 @@ Panel.prototype = {
             displayDate.setMinutes(displayDate.getMinutes() + 1);
             msecRemaining += 60000;
         }
-        this._clock.set_text(displayDate.toLocaleFormat("%a %l:%M %p"));
+        /* Translators: This is a time format.  */
+        this._clock.set_text(displayDate.toLocaleFormat(_("%a %l:%M %p")));
         Mainloop.timeout_add(msecRemaining, Lang.bind(this, this._updateClock));
         return false;
     },
index becac0a2f302f8036dad93de19cfa068017e56bb..5ba561b57b21c52abf84c834859f6eed402008ea 100644 (file)
@@ -6,6 +6,8 @@ const Lang = imports.lang;
 const Mainloop = imports.mainloop;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const Main = imports.ui.main;
 
@@ -69,7 +71,7 @@ RunDialog.prototype = {
 
         let label = new Clutter.Text({ color: BOX_TEXT_COLOR,
                                        font_name: '18px Sans',
-                                       text: 'Please enter a command:' });
+                                       text: _("Please enter a command:") });
         label.set_position(6, 6);
         boxGroup.add_actor(label);
 
index b33028a97691aed5f77d1c23c5f9b8d57b87ccc4..4ec371f28fe12ed9a94a40319387eb4adc00aa8b 100644 (file)
@@ -9,6 +9,8 @@ const Lang = imports.lang;
 const Pango = imports.gi.Pango;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
+const Gettext = imports.gettext.domain('gnome-shell');
+const _ = Gettext.gettext;
 
 const DocInfo = imports.misc.docInfo;
 
@@ -156,7 +158,8 @@ ClockWidget.prototype = {
     },
 
     _updateText: function(time) {
-        this.actor.set_text(time.toLocaleFormat("%H:%M"));
+        // Translators: This is a time format.
+        this.actor.set_text(time.toLocaleFormat(_("%H:%M")));
     },
 
     _updateCairo: function(time) {
@@ -311,7 +314,7 @@ AppsWidget.prototype = {
     _init : function() {
         Widget.prototype._init.apply(this, arguments);
 
-        this.title = "Applications";
+        this.title = _("Applications");
         this.actor = new Big.Box({ spacing: 2 });
         this.collapsedActor = new Big.Box({ spacing: 2});
 
@@ -336,7 +339,7 @@ RecentDocsWidget.prototype = {
     _init : function() {
         Widget.prototype._init.apply(this, arguments);
 
-        this.title = "Recent Documents";
+        this.title = _("Recent Documents");
         this.actor = new Big.Box({ spacing: 2 });
 
         this._recentManager = Gtk.RecentManager.get_default();